package com.cloudkinto.service.platform;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.order.allocate.AllocatePlanProductQueryBo;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.dto.platform.product.PlatformProductDto;
import com.cloudkinto.dto.platform.product.ProductSysDto;
import com.cloudkinto.entity.PlatformProductDo;
import com.cloudkinto.service.consumer.vo.order.UpdateInventoryLessReq;
import com.cloudkinto.service.platform.vo.product.*;
import com.cloudkinto.service.stock.vo.snap.ProductWeightReq;
import com.cloudkinto.vo.order.allocate.AllocateProductListVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author hua
 * @since 2025-01-02
 */
public interface PlatformProductService extends IService<PlatformProductDo> {

    void updateInventoryLess(UpdateInventoryLessReq req);
    void updateProduct(PlatformUpdateReq req, Long userId, Long companyId);

    AllocatePlatformUpdateRes updatePlatformProductAndReturnStock(AllocatePlatformUpdateReq bo, Long userId, Long tenantId, Long companyId);

    PlatformProductDto updateInit(Long id, Long companyId);

    Object add(PlatformAddReq req, Long userId, Long companyId);

    String addNoEx(PlatformAddReq req, Long userId, Long companyId, Long tenantId);

    int delete(List<Long> ids, Long userId);

    SingleResult pageInit(Long companyId);

    List<PlatformProductDto> getList(Map<String, Object> map);

    PageResult getListPage(Map<String, Object> map);

    void getPlatformProductTemplate(HttpServletResponse response, Long companyId) throws Exception;

    PlatformProductImportRes importT(MultipartFile file, Long userId, Long companyId, Long tenantId);

    void platformProductExport(Map<String, Object> map, HttpServletResponse response);

    List<ProductSysDto> getSystemSkuList(List<String> platformSkus, Long storeId);

    void insert(PlatformProductDo storeDo, Long userId);

    void save(List<PlatformProductDo> productDoList, String platformCode, boolean delete, Long storeId, Long companyId);

    void manualSyncPlatformProduct(ManualSyncPlatformProductReq req, Long userId);

    void getPlatformProductUpdateTemplate(HttpServletResponse response, Long companyId) throws IOException;

    void importBatchUpdate(MultipartFile file, Long userId, Long companyId);

    void importUpdate(PlatProductUpdateConsumerReq req);

    void getPlatformProductDeleteParentSkuTemplate(HttpServletResponse response, Long companyId) throws IOException;

    void getPlatformProductDeletePlatformSkuTemplate(HttpServletResponse response, Long companyId) throws IOException;

    void importDelete(MultipartFile file, Integer deleteType, Long userId, Long companyId);

    void updateInventoryBatch(Map<String, Object> map);

    Object addWeight(ProductWeightReq req, Long userId, Long companyId);

    List<AllocateProductListVo> getAllocatePlanProductListPage(AllocatePlanProductQueryBo bo);
}
